file_name = 'text_files\\like_reason.txt'

with open(file_name,'w') as file_obj:
    reason = input("Enter your reason : ")
    while reason!='-1':
        file_obj.write(f"{reason}\n")
        reason = input()
